package vip.liux.backend.adapter.web;


import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import vip.liux.core.utils.JsonUtils;
import vip.liux.settings.provider.ISettingProvider;

import java.util.Map;

@RestController
@RequestMapping("/api/store")
public class StoreController {

    private final ISettingProvider settingProvider;

    public StoreController(ISettingProvider settingProvider) {
        this.settingProvider = settingProvider;
    }

    @GetMapping("/info")
    public Object getStoreInfo() {
        settingProvider.get("shop.setting.store");
        return Map.<String, Object>of("storeInfo", JsonUtils.toObject(settingProvider.get("shop.setting.store"), Object.class));
    }

}
